<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Home::index');
// 路由规则：GET请求的/travel路径 → 对应Travel控制器的index()方法
$routes->get(from: "travel", to: "Travel::index");
// 路由规则：GET请求的/travel/showme/X路径 → Travel控制器的showme()方法（X为任意值，传递给$id参数）
$routes->get(from: '/travel/showme/(:any)', to: "Travel::showme/$1");
// 路由规则：GET请求的/image/文件名路径 → Media控制器的image()方法
$routes->get(from: '/image/(:any)', to: "Media::image/$1");
// 根路径（/） → 直接渲染home视图（首页）
$routes->get(from: '/', to: function () {
    return view('home');
});